import http from '@/utils/http'
import type { JobAddParams, JobListParams, JobResponse, JobResponseData } from '../types/Position'
import { RoleOptionResponse } from '../types/user'

enum API {
    PosiList_URL = '/api/etp/job/list',
    PosiPerson_URL = '/api/acl/role/rolelist',
    PosiAdd_URL = '/api/etp/job/add',
    PosiEdit_URL = '/api/etp/job/edit',
    PosiDelete_Url='/api/etp/job/delete'
}

// 职位列表
export const reqPosiList = (data: JobListParams) => http.get<any, JobResponseData>(API.PosiList_URL, { params: data })

// 职位人列表信息
export const reqPersonList = () => http.get<any, RoleOptionResponse>(API.PosiPerson_URL)

// 新增职位
export const reqPosiAdd = (data: JobAddParams) => http.post<any, JobResponse>(API.PosiAdd_URL, data)

// 编辑职位
export const reqPosiEdit = (data: JobAddParams) => http.post<any, JobResponse>(API.PosiEdit_URL, data)

// 删除职位
export const reqPosiDelete =(id:string)=>http.delete<any,JobResponse>(API.PosiDelete_Url,{params:{id}})